<?php
/**
 * Created by PhpStorm.
 * User: sunfan
 * Date: 2017/8/16
 * Time: 10:00
 */

namespace App\Controller;


class ApiBaseController extends MapController
{
    //  获取token
    protected function getToken($openID){
       $token = md5($openID.time());
       $user_id = D("Member")->where(array('openID'=>$openID))->getField('id');
       S($token,$user_id);
       return $token;
    }

    // 获取用户ID
    protected function getUserID($token){
       $id = S($token)?S($token):0;
       return $id;
    }
}